package com.ruoyi.question.service.impl;

import com.ruoyi.question.domain.DtAnswer;
import com.ruoyi.question.mapper.DtAnswerMapper;
import com.ruoyi.question.service.IDtAnswerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 答案Service业务层处理
 *
 * @author llc
 * @date 2025-01-06
 */
@Service
public class DtAnswerServiceImpl implements IDtAnswerService {
    @Autowired
    private DtAnswerMapper dtAnswerMapper;

    /**
     * 查询答案
     *
     * @param id 答案主键
     * @return 答案
     */
    @Override
    public DtAnswer selectDtAnswerById(Long id) {
        return dtAnswerMapper.selectDtAnswerById(id);
    }

    /**
     * 查询答案列表
     *
     * @param dtAnswer 答案
     * @return 答案
     */
    @Override
    public List<DtAnswer> selectDtAnswerList(DtAnswer dtAnswer) {
        return dtAnswerMapper.selectDtAnswerList(dtAnswer);
    }

    /**
     * 新增答案
     *
     * @param dtAnswer 答案
     * @return 结果
     */
    @Override
    public int insertDtAnswer(DtAnswer dtAnswer) {
        return dtAnswerMapper.insertDtAnswer(dtAnswer);
    }

    /**
     * 修改答案
     *
     * @param dtAnswer 答案
     * @return 结果
     */
    @Override
    public int updateDtAnswer(DtAnswer dtAnswer) {
        return dtAnswerMapper.updateDtAnswer(dtAnswer);
    }

    /**
     * 批量删除答案
     *
     * @param ids 需要删除的答案主键
     * @return 结果
     */
    @Override
    public int deleteDtAnswerByIds(Long[] ids) {
        return dtAnswerMapper.deleteDtAnswerByIds(ids);
    }

    /**
     * 删除答案信息
     *
     * @param id 答案主键
     * @return 结果
     */
    @Override
    public int deleteDtAnswerById(Long id) {
        return dtAnswerMapper.deleteDtAnswerById(id);
    }
}
